home *** CD-ROM | disk | FTP | other *** search
- %if MenuItemName = Cut%
- /*----------*/
- static void DoCut (void)
- {
- if (cur->text != nil) {
- TECut (cur->text);
- cur->dirty = true;
- scrapDirty = true;
- }
- } /*DoCut*/
-
- %elsif MenuItemName = Copy%
- /*----------*/
- static void DoCopy (void)
- {
- if (cur->text != nil) {
- TECopy (cur->text);
- scrapDirty = true;
- }
- } /*DoCopy*/
-
- %elsif MenuItemName = Paste%
- /*----------*/
- static void DoPaste (void)
- {
- if (cur->text != nil) {
- TEPaste (cur->text);
- cur->dirty = true;
- }
- } /*DoPaste*/
-
- %elsif MenuItemName = Clear%
- /*----------*/
- static void DoClear (void)
- {
- if (cur->text != nil) {
- TEDelete (cur->text);
- cur->dirty = true;
- }
- } /*DoClear*/
-
- %elsif MenuItemName = SelectAll%
- /*----------*/
- static void DoSelectAll (void)
- {
- if (cur->text != nil) {
- TESetSelect (0, 32767, cur->text);
- }
- } /*DoSelectAll*/
-
- %elsif menuitemname = CreatePublisher%
- /*----------*/
- static void DoCreatePublisher (void)
- {
- #if 0
- OSErr theErr;
- NewPublisherReply pdReply;
-
- #include <Packages.h>
- pdReply.usePart = false;
- pdReply.preview = nil; /*should be handle to and*/
- pdReply.previewFormat = 'TEXT'; /*type of preview data*/
-
- /* fill in pdReply.container: */
- HLock ((Handle)cur->filename);
- theErr = FSMakeFSSpec(cur->volNum, 0L /*dirID*/, *cur->filename,
- &pdReply.container.theFile);
- /*should really pass default edition name*/
- /*instead of cur->filename*/
- HUnlock ((Handle)cur->filename);
- if (theErr == noErr) { /* FSMakeFSSpec went ok */
- pdReply.container.theFileScript = iuCurrentScript;
- /* should be script code for cur->filename */
- pdReply.container.thePart = kPartsNotUsed;
- pdReply.container.thePartName[0] = 0; /* not used */
- pdReply.container.thePartScript = 0; /* not used */
-
- theErr = NewPublisherDialog (&pdReply);
- if ((theErr == noErr) && (!pdReply.canceled)) {
- /* handle new publisher */
- } /* otherwise, NewPublisherDialog error or user cancelled */
- } else {
- /* handle FSMakeFSSpec error */
- }
- #endif
- } /*DoCreatePublisher*/
-
- %elsif menuitemname = SubscribeTo%
- /*----------*/
- static void DoSubscribeTo (void)
- {
- OSErr theErr;
- NewSubscriberReply sdReply;
-
- sdReply.formatsMask = kTEXTformatMask;
- theErr = GetLastEditionContainerUsed (&sdReply.container);
- theErr = NewSubscriberDialog (&sdReply);
- if (!sdReply.canceled) {
- /* handle subscriber to */
- }
- } /*DoSubscribeTo*/
-
- %elsif menuitemname = SubscriberOptions%
- /*----------*/
- /* This procedure displays either the publisher options or */
- /* subscriber options dialog, depending on what's selected. */
- /*----------*/
- static void DoSubscriberOptions (void)
- {
- OSErr theErr;
- SectionOptionsReply soReply;
-
- theErr = SectionOptionsDialog (&soReply);
- if ((theErr == noErr) && (!soReply.canceled)) {
- switch (soReply.action) {
- case 'read': /* "Get Edition Now" */
- break;
- case 'writ': /* "Send Edition Now" */
- break;
- case 'goto': /* "Open Publisher" */
- break;
- case 'cncl': /* "Cancel Publisher/Subscriber" */
- break;
- case ' ': /* "OK" */
- break;
- } /* switch */
- }
- } /*DoSubscriberOptions*/
-
- %else%
- %DoMenuItem%
- %end if%
-